/*
 * @Author: xmily
 * @Date: 2022-02-14 02:12:45
 * @LastEditors: xmily
 * @LastEditTime: 2022-09-19 01:03:57
 * @FilePath: \glxxapi\models\AfterClassService\c2t.js
 * @Description: 
 * 
 * Copyright (c) 2022 by xmily/mxthink.com.cn, All Rights Reserved. 
 */
//课后服务老师与班级之间的对应关系
var mongoose = require('../../cfg/dbconfig.js')

var aftclsvr_c2t_Schema=new mongoose.Schema({
    schoolname:String,
    term:String,
    teachers:[],
    className:String,
    type:String,
},{collection:'aftclsvr_c2t'})

aftclsvr_c2t_Schema.statics.GetByQuery = async function (query, field, sort) {
    sort = sort || { _id: 1 };
    field = field || {};
    let result = await this.find(query, field).sort(sort).exec();
    return result;
};

aftclsvr_c2t_Schema.statics.UpdateManyByQuery = async function (
    query,
    update,
    // options
  ) {
    // options = options || { upsert: false, multi: false };
    let result = await this.updateMany(query, update).exec();
    return result;
  };



module.exports = mongoose.model('aftclsvr_c2t', aftclsvr_c2t_Schema)